#pragma once
#include <ros/ros.h>
#include <iostream>
#include <vector>
#include "common_lib/common.h"
#include "task_custom_class.h"

#include "task_msgs/task_msg.h"
#include "task_msgs/task_path.h"
#include "task_msgs/task_point.h"
#include "task_msgs/work_task.h"

#include "actuator_msgs/actuator_msg.h"
#include "control_msgs/control_msg.h"
#include "control_msgs/control_state_msg.h"

#include "common_lib/log.h"
#include "yaml-cpp/yaml.h"
#include <json/json.h>

namespace task
{
    class TaskHandleBase
    {
    public:
        virtual ~TaskHandleBase(){};
        virtual bool Init(std::string param_file) = 0;
        virtual void Reset() = 0;
        virtual void ReadData(sTaskReceive &task_cmd) = 0;
        virtual void WriteData(std::string write_mode, sAMRState &amr_state, unsigned int _SN) = 0;
        virtual void WriteData(std::string write_mode, sAMRState &amr_state) = 0;
        virtual void WriteData(std::string write_mode, std::string file_path) = 0;
        
        bool ParseWorkTask(task::sWorkTask &work_task, const std::string &action, const std::string &param);

        //上装类型,需要与control_msgs/WorkTypeMsg.msg一致
        const std::vector<std::string> work_task_types = {"load", "stretch", "rotate_yaw", "rotate_pitch"};

        std::string map_id_;
        common_lib::Common con_lib_;
        void ResetMapID(const std::string &map_id) 
        { 
            map_id_ = map_id;
        }
    };
} // namespace task